/**
 * Created by Administrator on 2015/5/30.
 */
/*
err:读取错误时触发的对象
fd: 整数值，代表打开文件的索引。
* */
var fs = require('fs');
fs.open('./ygl.txt','r',function(err,fd){
    console.log(fd);
});
fs.open('./ygl.txt','r',function(err,fd){
    var buff=new Buffer(12);
    fs.read(fd,buff,0,6,0,function(err,bytesRead,buffer){
       // console(buff.toString());
        fs.read(fd,buff,6,6,6,function(err,bytesReay,buffer){
            console.log(bytesRead);
            console.log(buff);
            console.log(buff.toString());
            console.log(buff === buffer);
        });
    });

});